module com {

	module taysear {
	
		module dbservice {	
		
			dictionary<string, string> Parameter;
			
			class ServiceResult {
				bool status;				
				string message;
				Parameter param;
			};	
			
			class ServiceParameter {
				Parameter param;
			};
			
			exception TException {
				int errorCode;
				string errorDescription;
				string errorStackTrace;
			};
			
			interface DbServices {
			
				/**
				* Autenticates user by its username and password.
				* 
				* <ul> param contains:
				*	<li> username, required</li>
				*	<li> password, required </li>
				* </ul>
				* @return ServiceResult
				*
				* <ul> param contains:
				*	<li> RECORDS, XML data that contains user table content</li>
				*	<li> EMPLOYEE, XML data that contains employee table content </li>
				*	<li> COUNTRY, XML data that contains country table content </li>
				*	<li> CURRENCY, XML data that contains currency table content </li>
				* </ul>
				*/
				ServiceResult login(ServiceParameter sp);
				/*****************************************************************************************/
				
				/**
				* Gets portal menus and permissions by user id and portal id.
				* 
				* <ul> param contains:
				*	<li> userId, required </li>
				*	<li> portalId, required </li>
				* </ul>
				* @return ServiceResult
				*
				* <ul> param contains:
				*	<li> RECORDS, XML data that contains permission table content</li>
				* <ul> 
				*/
				ServiceResult getPermissionsByUserIdAndPortalId(ServiceParameter sp);
				/*****************************************************************************************/
				
				/**
				* Gets (new, edited, loaded) routes for (loadingsheet/bus manifest) by date.
				* 
				* <ul> param contains:
				*	<li> startDate, required </li>
				*	<li> endDate, required </li>
				* </ul>
				*
				* @return ServiceResult
				*
				* <ul> param contains:
				*	<li> RECORDS, XML data that contains route and route time table content</li>
				* <ul> 
				*/
				ServiceResult getLoadingsheetRoutesByDate(ServiceParameter sp);
				/*****************************************************************************************/
				
				/**
				* Gets available seats for loadingsheet by route time id.
				* 
				* <ul> param contains:
				*	<li> routeTimeId, required </li>
				* </ul>
				* @return ServiceResult
				*
				* <ul> param contains:
				*	<li> RECORDS, XML data that contains seat table content</li>
				* <ul> 
				*/
				ServiceResult getAvailableSeatsForLoadingsheetByRouteTimeId(ServiceParameter sp);
				/*****************************************************************************************/
				
				/**
				* Gets substations by route id.
				* 
				* <ul> param contains:
				*	<li> routeTimeId, required </li>
				* </ul>
				* @return ServiceResult
				*
				* <ul> param contains:
				*	<li> RECORDS, XML data that contains substation table content</li>
				* <ul> 
				*/
				ServiceResult getSubstationsByRouteTimeId(ServiceParameter sp);
				/*****************************************************************************************/
				
				/**
				* Gets bus fare by from and to substation.
				* 
				* <ul> param contains:
				*	<li> fromSubstation, required </li>
				*	<li> toSubstation, required </li>
				* </ul>
				*
				* @return ServiceResult
				*
				* <ul> param contains:
				*	<li> RECORDS, XML data that contains route table content</li>
				* <ul> 
				*/
				ServiceResult getBusFareByFromToSubstationId(ServiceParameter sp);
				/*****************************************************************************************/
				
				/**
				* Gets all nationalities.
				* 
				* @return ServiceResult
				*
				* <ul> param contains:
				*	<li> RECORDS, XML data that contains country table content</li>
				* <ul> 
				*/
				ServiceResult getAllNationalities(ServiceParameter sp);
				/*****************************************************************************************/
				
				/**
				* Save booking.
				* 
				* <ul> param contains:
				*	<li> userId, required </li>
				*	<li> travelDate, required </li>
				*	<li> loadingsheetId, required </li>
				*	<li> seatId, required </li>
				*	<li> name, required </li>
				*	<li> mobile, required </li>
				*	<li> nationality, required </li>
				*	<li> idNumber, required </li>
				*	<li> childAge, required </li>
				*	<li> fromSubstation, required </li>
				*	<li> toSubstation, required </li>
				*	<li> amount, required </li>
				*	<li> currencyName, required </li>
				*	<li> pickupPoint, required </li>
				*	<li> bookingAction, required </li>
				*	<li> bookingStatus, required </li>
				*	<li> seatStatus, required </li>
				*	<li> isOneWay, required </li>
				* </ul>
				*
				* @return ServiceResult
				*
				* <ul> param contains:
				*	<li> bookingId </li>
				*	<li> actionDate </li>
				* <ul> 
				*
				*/
				ServiceResult saveBooking(ServiceParameter sp);
				/*****************************************************************************************/
				
				/**
				* Search booking by filters.
				* 
				* <ul> param contains:
				*	<li> filterBy ([1, bookingId] [2, customerMobile]) , required </li>
				*	<li> filterValue, required </li>
				*	<li> startIndex, required </li>
				*	<li> pageSize, required </li>
				* </ul>
				*
				* @return ServiceResult
				*
				* <ul> param contains:
				*	<li> RECORDS, XML data that contains booking table content</li>
				* <ul> 
				*
				*/
				ServiceResult searchBooking(ServiceParameter sp);
				/*****************************************************************************************/
				
				/**
				* Set booking to open.
				* 
				* <ul> param contains:
				*	<li> userId, required </li>
				*	<li> bookingId, required </li>
				*	<li> amount, required </li>
				*	<li> routeTimeSeatId, required </li>
				*	<li> bookingAction, required </li>
				*	<li> bookingStatus, required </li>
				*	<li> seatStatus, required </li>
				*	<li> description, required </li>
				*	<li> currencyId, required </li>
				* </ul>
				*
				* @return ServiceResult
				*
				* <ul> param contains:
				*	<li> voucherId </li>
				* <ul> 
				*/
				ServiceResult setBookingOpen(ServiceParameter sp);
				/*****************************************************************************************/
				
				/**
				* Cancel booking.
				* 
				* <ul> param contains:
				*	<li> userId, required </li>
				*	<li> bookingId, required </li>
				*	<li> routeTimeSeatId, required </li>
				*	<li> bookingAction, required </li>
				*	<li> bookingStatus, required </li>
				*	<li> seatStatus, required </li>
				*	<li> description, required </li>
				* </ul>
				*
				* @return ServiceResult
				*
				*/
				ServiceResult cancelBooking(ServiceParameter sp);
				/*****************************************************************************************/
				
				/**
				* Change booking.
				* 
				* <ul> param contains:
				*	<li> userId, required </li>
				*	<li> bookingId required</li>
				*	<li> travelDate, required </li>
				*	<li> loadingsheetId, required </li>
				*	<li> oldSeatId, required </li>
				*	<li> seatId, required </li>
				*	<li> name, required </li>
				*	<li> mobile, required </li>
				*	<li> nationality, required </li>
				*	<li> idNumber, required </li>
				*	<li> childAge, required </li>
				*	<li> fromSubstation, required </li>
				*	<li> toSubstation, required </li>
				*	<li> amount, required </li>
				*	<li> currencyName, required </li>
				*	<li> pickupPoint, required </li>
				*	<li> bookingAction, required </li>
				*	<li> bookingStatus, required </li>
				*	<li> oldSeatStatus, required </li>
				*	<li> seatStatus, required </li>
				* </ul>
				*
				* @return ServiceResult
				*
				* <ul> param contains:
				*	<li> bookingId </li>
				*	<li> actionDate </li>
				* <ul> 
				*
				*/
				ServiceResult changeBooking(ServiceParameter sp);
				/*****************************************************************************************/
				
				/**
				* Gets the system configurations.
				* 
				*
				* @return ServiceResult
				*
				* <ul> param contains:
				*	<li> RECORDS, XML data that contains system configuration table content</li>
				* <ul> 
				*
				*/
				ServiceResult getSystemConfigurations(ServiceParameter sp);
				/*****************************************************************************************/
				
				/**
				* Gets all substations.
				* 
				* @return ServiceResult
				*
				* <ul> param contains:
				*	<li> RECORDS, XML data that contains substation table content</li>
				* <ul> 
				*/
				ServiceResult getAllSubstations(ServiceParameter sp);
				/*****************************************************************************************/
				
				/**
				* Gets (new, edited, loaded) routes for (loadingsheet/bus manifest) by from and to substation and date.
				* 
				* <ul> param contains:
				*	<li> fromSubstation, required </li>
				*	<li> toSubstation, required </li>
				*	<li> startDate, required </li>
				*	<li> endDate, required </li>
				*	<li> isDeparture, required </li>
				* </ul>
				*
				* @return ServiceResult
				*
				* <ul> param contains:
				*	<li> RECORDS, XML data that contains route and route time table content</li>
				* <ul> 
				*/
				ServiceResult getRoutesBySubstationsAndDates(ServiceParameter sp);
				/*****************************************************************************************/
				
				/**
				* Save multiple bookings at once.
				* 
				* <ul> param contains:
				*	<li> bookings, required. Bookings contain: </li>
				*							<br/> userId, required
				*							<br/> travelDate, required
				*							<br/> loadingsheetId, required
				*							<br/> seatId, required
				*							<br/> name, required
				*							<br/> mobile, required
				*							<br/> nationality, required
				*							<br/> idNumber, required
				*							<br/> childAge, required
				*							<br/> fromSubstation, required
				*							<br/> toSubstation, required 
				*							<br/> amount, required
				*							<br/> currencyName, required
				*							<br/> pickupPoint, required
				*							<br/> bookingAction, required
				*							<br/> bookingStatus, required
				*							<br/> seatStatus, required
				*							<br/> isOneWay, required <br/>
				* </ul>
				*
				* @return ServiceResult
				*
				* <ul> param contains:
				*	<li> bookings contains: </li>
				*				<br/> bookingId
				*				<br/> actionDate </br>
				* <ul> 
				*
				*/
				ServiceResult saveBookings(ServiceParameter sp);
				/*****************************************************************************************/
				
				/**
				* Gets all the data from time table.
				* 
				* @return ServiceResult
				*
				* <ul> param contains:
				*	<li> RECORDS, XML data that contains time table content</li>
				* <ul> 
				*/
				ServiceResult getTimes(ServiceParameter sp);
				/*****************************************************************************************/
				
				/**
				* Add time.
				* 
				* <ul> param contains:
				*	<li> userId, required </li>
				*	<li> reportingTime, required </li>
				*	<li> departureTime, required </li>
				*	<li> ampm, required </li>
				* </ul>
				*
				* @return ServiceResult
				*
				*/
				ServiceResult addTime(ServiceParameter sp);
				/*****************************************************************************************/
				
				/**
				* Edit time.
				* 
				* <ul> param contains:
				*	<li> userId, required </li>
				*	<li> timeId, required </li>
				*	<li> reportingTime, required </li>
				*	<li> departureTime, required </li>
				*	<li> ampm, required </li>
				* </ul>
				*
				* @return ServiceResult
				*
				*/
				ServiceResult editTime(ServiceParameter sp);
				/*****************************************************************************************/
				
				/**
				* Gets all the data from route table.
				* 
				* @return ServiceResult
				*
				* <ul> param contains:
				*	<li> RECORDS, XML data that contains route table content</li>
				* <ul> 
				*/
				ServiceResult getRoutes(ServiceParameter sp);
				/*****************************************************************************************/
				
				/**
				* Add route.
				* 
				* <ul> param contains:
				*	<li> userId, required </li>
				*	<li> routeStart, required </li>
				*	<li> routeEnd, required </li>
				*	<li> dateCreated, required </li>
				*	<li> routeStatus, required </li>
				* </ul>
				*
				* @return ServiceResult
				*
				*/
				ServiceResult addRoute(ServiceParameter sp);
				/*****************************************************************************************/
				
				/**
				* Edit route.
				* 
				* <ul> param contains:
				*	<li> userId, required </li>
				*	<li> routeId, required </li>
				*	<li> routeStatus, required </li>
				* </ul>
				*
				* @return ServiceResult
				*
				*/
				ServiceResult editRoute(ServiceParameter sp);
				/*****************************************************************************************/
				
				/**
				* Gets all the substations in route details, divided in to two, the current substations and the available once.
				* 
				* <ul> param contains:
				*	<li> userId, required </li>
				*	<li> routeId, required </li>
				*	<li> getAvailable </li>
				* </ul>
				*
				* @return ServiceResult
				*
				* <ul> param contains:
				*	<li> RECORDS, XML data that contains substation table content</li>
				*	<li> available, XML data that contains substation table content. Contains data only if getAvailable is true.</li>
				* <ul> 
				*/
				ServiceResult getRouteDetails(ServiceParameter sp);
				/*****************************************************************************************/
				
				/**
				* Save route details.
				* 
				* <ul> param contains:
				*	<li> userId, required </li>
				*	<li> routeId, required </li>
				*	<li> routeDetails, required. routeDetails contain: </li>
				*							<br/> routeOrder, required
				*							<br/> substationId, required
				* </ul>
				*
				* @return ServiceResult
				*
				*/
				ServiceResult saveRouteDetails(ServiceParameter sp);
				/*****************************************************************************************/
				
				/**
				* Gets active, inactive and available times for a route.
				* 
				* <ul> param contains:
				*	<li> userId, required </li>
				*	<li> routeId, required </li>
				*	<li> getAvailable </li>
				* </ul>
				*
				* @return ServiceResult
				*
				* <ul> param contains:
				*	<li> RECORDS, XML data that contains time table content</li>
				*	<li> inActive, XML data that contains time table content. .</li>
				*	<li> available, XML data that contains time table content. Contains data only if getAvailable is true.</li>
				* <ul> 
				*/
				ServiceResult getRouteTimes(ServiceParameter sp);
				/*****************************************************************************************/
				
				/**
				* Save route times.
				* 
				* <ul> param contains:
				*	<li> userId, required </li>
				*	<li> routeId, required </li>
				*	<li> setActive</li>
				*	<li> setInActive</li>
				*	<li> createNew</li>
				* </ul>
				*
				* @return ServiceResult
				*
				*/
				ServiceResult saveRouteTimes(ServiceParameter sp);
				/*****************************************************************************************/
				
				/**
				* Gets all the data from seat table.
				* 
				* @return ServiceResult
				*
				* <ul> param contains:
				*	<li> RECORDS, XML data that contains seat table content</li>
				* <ul> 
				*/
				ServiceResult getSeats(ServiceParameter sp);
				/*****************************************************************************************/
				
				/**
				* Add seat.
				* 
				* <ul> param contains:
				*	<li> userId, required </li>
				*	<li> description, required </li>
				* </ul>
				*
				* @return ServiceResult
				*
				*/
				ServiceResult addSeat(ServiceParameter sp);
				/*****************************************************************************************/
				
				/**
				* Edit seat.
				* 
				* <ul> param contains:
				*	<li> userId, required </li>
				*	<li> seatId, required </li>
				*	<li> description, required </li>
				* </ul>
				*
				* @return ServiceResult
				*
				*/
				ServiceResult editSeat(ServiceParameter sp);
				/*****************************************************************************************/
				
				/**
				* Gets active, inactive and available times for a route.
				* 
				* <ul> param contains:
				*	<li> userId, required </li>
				*	<li> startDate, required </li>
				*	<li> endDate, required </li>
				* </ul>
				*
				* @return ServiceResult
				*
				* <ul> param contains:
				*	<li> RECORDS, XML data that contains loadingsheet table content</li>
				* <ul> 
				*/
				ServiceResult getLoadingsheetByDates(ServiceParameter sp);
				/*****************************************************************************************/
			};
		};			
	};
};